<template>
  <view>
    <view class="navBar">
      <navigator open-type="navigateBack">
        <image src="../../../static/images/banner/back.png" mode="aspectFit" style="width: 40rpx;height: 40rpx;"></image>
      </navigator>
      <text class="textone">新增任务</text>
    </view>

    <view class="neirong">
      <view class="heng">
        <text>所在场区</text>
        <uni-data-select 
          v-model="value"
          :localdata="range"
          @change="change">
        </uni-data-select>
      </view>

      <view class="heng">
		  <navigator url="/pages/renwuguanli/taskDetail/taskDetail" open-type="navigate">
        <text>任务状态</text>
		</navigator>
        <uni-segmented-control 
          :current="current" 
          :values="items" 
          @clickItem="onClickItem" 
          styleType="button" 
          activeColor="rgb(119,119,119)">
        </uni-segmented-control>
      </view>

      <view class="content" style="width: 90%;">
        <view v-show="current === 0" v-for="item in shuju">
		
				<view v-if="item.status==='FINISH_NOT'">
					<renwu :customProp="item"></renwu>
				</view>
			
        </view>
        <view v-show="current === 1" v-for="item in shuju">
        	<view v-if="item.status==='FINISHIED'">
        		<renwu :customProp="item"></renwu>
        	</view>
          
        </view>
      </view>
    </view>
  </view>
</template>

<script>import renwu from '../component/renwu.vue'

export default {
  data() {
    return {
      value: 1,
      range: [
        { value: 0, text: "篮球" },
        { value: 1, text: "足球" },
        { value: 2, text: "游泳" },
      ],
      items: ['待完成', '已完成'],
      current: 0,
      shuju: [
        {
          type: '消毒',
          name: '001',
          status: 'FINISH_NOT',
          deptId: '场区',
          uername: '李四',
          remark: '这位是备注',
          createTime: '2024-7-21 08:00:02',
          createBy: '张三',
		  finishLink:'122',
		  finishTime:''
        },
        {
          type: '消毒',
          name: '001',
          status: 'FINISH_NOT',
          deptId: '场区',
          uername: '李四',
          remark: '这位是备注',
          createTime: '2024-7-21 08:00:02',
          createBy: '王麻子',
		  finishLink:'122',
		  finishTime:''
        },
        {
          type: '消毒',
          name: '001',
          status: 'FINISHIED',
          deptId: '场区',
          uername: '王五',
          remark: '这位是备注',
          createTime: '2024-7-21 08:00:02',
          createBy: '张三',
		  finishLink:'122',
		  finishTime:'2024-7-08'
        }
      ]
    }
  },
  methods: {
    change(e) {
      console.log("e:", e);
    },
    onClickItem(e) {
      if (this.current !== e.currentIndex) {
        this.current = e.currentIndex;
      }
    }
  },
  components: {
    renwu
  }
}
</script>

<style>.navBar {
  width: 100%;
  background-color: rgb(0, 112, 255);
  height: 80rpx;
  display: flex;
  justify-content: space-between;
  padding: 20rpx 20rpx;
  box-sizing: border-box;
}

.textone {
  font-size: 36rpx;
  width: 100%;
  text-align: center;
  color: white;
  font-weight: 800;
}

.neirong {
  width: 100%;
  padding: 40rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heng {
  display: flex;
  width: 100%;
  padding: 20rpx 40rpx;
  align-items: center;
}
</style>